	<?php 
		$ci= &get_instance();
		$TOURNAMENT = $ci->tournament_entity->init("id", $_POST['tournament_id']);
		$rank_array = $ci->user_tournament_entity->getArrayListOfTournament($TOURNAMENT->getId());
		$iC = 1;
		$totalUsers = count($rank_array);
		$totalCoins = 0;
	?>
	
	<div class="clrboth"></div>
	<div class="grid1"><span class="bold" style="font-weight:bold;">Rank</span></div>
	<div class="grid3"><span class="bold" style="font-weight:bold;">Username</span></div>
	<div class="grid2"><span class="bold" style="font-weight:bold;">Points</span></div>
	<div class="grid2"><span class="bold" style="font-weight:bold;">Coins Staked</span></div>
	<div class="clrboth"></div>
	<?php foreach( $rank_array as $item ): ?>
		<?php 
			$USER = $ci->user_entity->init('id', $item->user_id);
			$coinsStaked = $ci->user_tournament_entity->myCoinsStakedInTournament($USER->getId(), $TOURNAMENT->getId());
			$totalCoins += $coinsStaked;
		?>
	 	<div class="grid1"><?php echo $iC++; ?></div>
		<div class="grid3"><?php echo $USER->getUserName(); ?></div>
		<div class="grid2"><?php echo $item->point; ?>&nbsp;</div>
		<div class="grid2"><?php echo $coinsStaked;?></div>
		<div class="clrboth"></div>
	<?php endforeach; ?>
	<div class="clrboth"></div>
	<div class="grid10" style="border-top:1px solid;margin-top:15px;">
		Total Users in Tournament: <?php echo $totalUsers;?> <br/>
		Total Coins Staked in Tourname: <?php echo $totalCoins;?>
	</div>

